package org.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 设备值
 *
 * @author Fz
 * @since 1.0.0 2024-02-26
 */
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("col_device_data_set")
public class ColDeviceDataSet {

    @IsKey
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    @Column(name = "device_id", comment = "设备ID", type = MySqlTypeConstant.BIGINT)
    private Long deviceId;

    /**
     * 数据名称
     */
    @Column(name = "data_name", comment = "数据名称", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String dataName;

    /**
     * 数据序列
     */
    @Column(name = "data_seq", comment = "数据序列", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String dataSeq;

    /**
     * 工程单位
     */
    @Column(name = "data_unit", comment = "工程单位", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String dataUnit;

    /**
     * 系数K
     */
    @Column(name = "coefficient", comment = "系数K", type = MySqlTypeConstant.FLOAT)
    private Float coefficient;

    /**
     * 偏移量z
     */
    @Column(name = "offset", comment = "偏移量z", type = MySqlTypeConstant.FLOAT)
    private Float offset;

    /**
     * 数据上限
     */
    @Column(name = "top_limit", comment = "数据上限", type = MySqlTypeConstant.FLOAT)
    private Float topLimit;

    /**
     * 数据下限
     */
    @Column(name = "lower_limit", comment = "数据下限", type = MySqlTypeConstant.FLOAT)
    private Float lowerLimit;

    /**
     * 图标
     */
    @Column(name = "icon", comment = "图标", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String icon;

    /**
     * 排序
     */
    @Column(name = "sort", comment = "排序", type = MySqlTypeConstant.TINYINT, length = 100)
    private Integer sort;

    /**
     * 数据类型：1采集数据，2模拟数据
     */
    @Column(name = "type", comment = "数据类型：1采集数据，2模拟数据", type = MySqlTypeConstant.TINYINT)
    private Integer type;

    /**
     * 公式
     */
    @Column(name = "formula_id", comment = "公式")
    private Long formulaId;

    /**
     * 创建者
     */
    @Column(name = "is_store", comment = "是否存储：1是，2否",type = MySqlTypeConstant.TINYINT)
    private Integer isStore;


    /**
     * 删除标志 0 正常 1 已删除
     */
    @Column(name = "is_active", comment = "是否启用：1是，2否", type = MySqlTypeConstant.TINYINT)
    private Integer isActive;

    /**
     * 创建者
     */
    @Column(name = "creator", comment = "创建者")
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_date", comment = "创建时间", type = MySqlTypeConstant.DATETIME, length = 100)
    private Date createDate;

    /**
     * 修改者
     */
    @Column(name = "updater", comment = "修改者")
    private Long updater;

    /**
     * 最后更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_date", comment = "更新时间", type = MySqlTypeConstant.DATETIME, length = 36)
    private Date updateDate;

    /**
     * 删除标志 0 正常 1 已删除
     */
    @Column(name = "del_flag", comment = "删除标志 0 正常 1 已删除", length = 2, type = MySqlTypeConstant.TINYINT)
    private Integer delFlag;

    /**
     * 删除者
     */
    @Column(name = "deleter", comment = "删除者")
    private Long deleter;

    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @Column(name = "delete_date", type = MySqlTypeConstant.DATETIME, comment = "删除时间")
    private Date deleteDate;

}